package io.bdmc.modules.bss.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.bdmc.common.annotation.FieldMeta;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 设备报警 实体
 * </p>
 *
 * @author ping
 * @since 2020-07-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@NoArgsConstructor
// "DeviceAlarm对象", description = "设备报警")
public class DeviceAlarm extends Model<DeviceAlarm> {

    private static final long serialVersionUID = 1L;

    // "自增id")
    @TableId(value = "alarm_id", type = IdType.AUTO)
    private Integer alarmId;

    // "部门id")
    private Integer deptId;

    // "告警数据类型")
    private String dataType;

    // "设备id")
    private Integer deviceId;

    private String deviceSn;

    // "通道号")
    @FieldMeta(name = "通道号", description = "通道号")
    private Integer channel;

    // "报警源")
    @FieldMeta(name = "报警源", description = "报警源")
    private Integer alarmSource;

    // "报警类型id")
    private Integer alarmTypeId;

    // "报警名称")
    @FieldMeta(name = "报警名称", description = "报警名称")
    private String alarmTypeName;

    // "报警编码")
    @FieldMeta(name = "报警编码", description = "报警编码")
    private String alarmTypeCode;

    // "报警级别")
    private String alarmLevel;

    // "开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime startTime;

    // "结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime endTime;

    // "监测参数1")
    private String monitorValue1;

    // "监测参数2")
    private String monitorValue2;

    // "监测参数3")
    private String monitorValue3;

    // "是否已处理")
    private Boolean processed;

    // "是否已结束")
    private Boolean endAlarm;

    // "处理人")
    private String processBy;

    // "报警文字描述")
    private String alarmMsg;

    // "处理时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime processTime;

    // "处理备注")
    private String processRemark;

    private String remark;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    private String createBy;

    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime lastTime;

    @TableField(exist = false)
    @FieldMeta(name = "设备名称", description = "设备名称")
    private String deviceName;

    @TableField(exist = false)
    private String deviceModel;

    @TableField(exist = false)
    private String possibleCause;

    @TableField(exist = false)
    private String processMethod;

    @TableField(exist = false)
    private String displayColor;

    @TableField(exist = false)
    private String playVoice;

    @TableField(exist = false)
    private String deviceDigest;

    @TableField(exist = false)
    private Integer fibreId;

    @TableField(exist = false)
    private String fibreName;

    @TableField(exist = false)
    private Integer fibreCoreIndex;
    @Override
    public Serializable pkVal() {
        return this.alarmId;
    }

}
